<!DOCTYPE HTML>
<html lang="zh-tw" >
    <!-- Start book python高级 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>互斥锁 | python高级</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-emphasize/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../day05/08.死锁.html" />
    
    
    <link rel="prev" href="../day05/06.多线程-共享全局变量问题.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="5.7"
        data-chapter-title="互斥锁"
        data-filepath="day05/07.互斥锁.md"
        data-basepath=".."
        data-revision="Sat Sep 08 2018 13:52:27 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Python高级
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="day01/index.html">
            
                
                    <a href="../day01/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Linux系统基础
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="day01/01.操作系统.html">
            
                
                    <a href="../day01/01.操作系统.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        操作系统(科普章节)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="day01/02.操作系统发展史.html">
            
                
                    <a href="../day01/02.操作系统发展史.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        操作系统发展史(科普章节)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="day01/03.Ubuntu图形界面入门.html">
            
                
                    <a href="../day01/03.Ubuntu图形界面入门.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        Ubuntu图形界面入门
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="day01/04.文件目录.html">
            
                
                    <a href="../day01/04.文件目录.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        文件目录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="day01/05.常用Linux命令的基本使用.html">
            
                
                    <a href="../day01/05.常用Linux命令的基本使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        常用Linux命令的基本使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="day01/06.Linux终端命令格式.html">
            
                
                    <a href="../day01/06.Linux终端命令格式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        Linux终端命令格式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="day01/07.常用Linux命令选项的使用.html">
            
                
                    <a href="../day01/07.常用Linux命令选项的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        常用Linux命令选项的使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="day02/index.html">
            
                
                    <a href="../day02/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        Linux系统命令
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="day02/01.高级Linux命令及命令选项.html">
            
                
                    <a href="../day02/01.高级Linux命令及命令选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        高级Linux命令及命令选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="day02/02.远程登录和远程拷贝.html">
            
                
                    <a href="../day02/02.远程登录和远程拷贝.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        远程登录和远程拷贝
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="day02/03.软件安装与卸载.html">
            
                
                    <a href="../day02/03.软件安装与卸载.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        软件安装与卸载
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="day02/04.编辑器vim.html">
            
                
                    <a href="../day02/04.编辑器vim.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        编辑器vim
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="day02/05.命令总结.html">
            
                
                    <a href="../day02/05.命令总结.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        命令总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="day03/index.html">
            
                
                    <a href="../day03/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        网络-UDP
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="day03/01.网络概述.html">
            
                
                    <a href="../day03/01.网络概述.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        网络概述
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="day03/02.ip地址.html">
            
                
                    <a href="../day03/02.ip地址.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        IP地址
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="day03/03.Linux命令-ping和ifconfig.html">
            
                
                    <a href="../day03/03.Linux命令-ping和ifconfig.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        Linux命令-ping和ifconfig
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="day03/04.端口.html">
            
                
                    <a href="../day03/04.端口.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        端口
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="day03/05.网络传输方式udp.html">
            
                
                    <a href="../day03/05.网络传输方式udp.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        网络传输方式-UDP
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="day03/06.socket介绍.html">
            
                
                    <a href="../day03/06.socket介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        socket介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="day03/07.udp网络程序-发送、接收数据.html">
            
                
                    <a href="../day03/07.udp网络程序-发送、接收数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        udp网络程序-发送、接收数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="day03/08.数据编码和解码.html">
            
                
                    <a href="../day03/08.数据编码和解码.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        数据编码和解码
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="day03/09.udp绑定端口号.html">
            
                
                    <a href="../day03/09.udp绑定端口号.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        udp绑定端口号
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="day03/11.案例-UDP发送广播消息.html">
            
                
                    <a href="../day03/11.案例-UDP发送广播消息.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        案例-udp发送广播消息
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="day03/12.udp聊天器.html">
            
                
                    <a href="../day03/12.udp聊天器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        案例-udp聊天器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="day04/index.html">
            
                
                    <a href="../day04/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        网络-TCP
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="day04/01.tcp简介.html">
            
                
                    <a href="../day04/01.tcp简介.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        网络传输方式-TCP
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="day04/02.tcp网络程序-客户端.html">
            
                
                    <a href="../day04/02.tcp网络程序-客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        TCP网络程序-客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="day04/03.tcp网络程序-服务端.html">
            
                
                    <a href="../day04/03.tcp网络程序-服务端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        TCP网络程序-服务端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="day04/04.tcp注意点.html">
            
                
                    <a href="../day04/04.tcp注意点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        TCP注意点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="day04/05.案例-文件下载器.html">
            
                
                    <a href="../day04/05.案例-文件下载器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        案例-文件下载器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="day04/06.tcp的3次握手.html">
            
                
                    <a href="../day04/06.tcp的3次握手.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        tcp的3次握手
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="day04/07.tcp的4次挥手.html">
            
                
                    <a href="../day04/07.tcp的4次挥手.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        tcp的4次挥手
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="day04/08.wireshark的使用.html">
            
                
                    <a href="../day04/08.wireshark的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.8.</b>
                        
                        wireshark的使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="day05/index.html">
            
                
                    <a href="../day05/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        多任务-线程
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="day05/01.多任务的介绍.html">
            
                
                    <a href="../day05/01.多任务的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        多任务的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="day05/02.线程.html">
            
                
                    <a href="../day05/02.线程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        线程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="day05/03.线程注意点.html">
            
                
                    <a href="../day05/03.线程注意点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        线程的注意点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="day05/04.自定义线程.html">
            
                
                    <a href="../day05/04.自定义线程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        自定义线程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="day05/05.多线程-共享全局变量.html">
            
                
                    <a href="../day05/05.多线程-共享全局变量.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        多线程-共享全局变量
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="day05/06.多线程-共享全局变量问题.html">
            
                
                    <a href="../day05/06.多线程-共享全局变量问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        多线程-共享全局变量问题
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="5.7" data-path="day05/07.互斥锁.html">
            
                
                    <a href="../day05/07.互斥锁.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        互斥锁
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="day05/08.死锁.html">
            
                
                    <a href="../day05/08.死锁.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        死锁
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="day05/09.案例-多任务udp聊天器.html">
            
                
                    <a href="../day05/09.案例-多任务udp聊天器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        案例-多任务版udp聊天器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="day05/10.案例-多任务版TCP服务端.html">
            
                
                    <a href="../day05/10.案例-多任务版TCP服务端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        案例-多任务版TCP服务端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.11" data-path="day05/11.案例-多任务版文件下载.html">
            
                
                    <a href="../day05/11.案例-多任务版文件下载.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.11.</b>
                        
                        案例-多任务版文件下载
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="day06/index.html">
            
                
                    <a href="../day06/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        多任务-进程
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="day06/01.进程介绍.html">
            
                
                    <a href="../day06/01.进程介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        进程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="day06/02.进程的使用.html">
            
                
                    <a href="../day06/02.进程的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        进程的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="day06/03.进程注意点.html">
            
                
                    <a href="../day06/03.进程注意点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        进程注意点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="day06/04.进程间通信-Queue.html">
            
                
                    <a href="../day06/04.进程间通信-Queue.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        进程间通信-Queue
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="day06/05.进程池.html">
            
                
                    <a href="../day06/05.进程池.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        进程的创建-进程池
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="day06/06.进程、线程对比.html">
            
                
                    <a href="../day06/06.进程、线程对比.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        进程和线程的对比
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="day06/07.案例-文件夹拷贝器-多任务版.html">
            
                
                    <a href="../day06/07.案例-文件夹拷贝器-多任务版.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        案例-多任务版文件夹拷贝器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="day07/index.html">
            
                
                    <a href="../day07/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        多任务-协程
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="day07/01.迭代.html">
            
                
                    <a href="../day07/01.迭代.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        迭代
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="day07/02.迭代器.html">
            
                
                    <a href="../day07/02.迭代器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        迭代器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="day07/03.生成器.html">
            
                
                    <a href="../day07/03.生成器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        生成器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="day07/04.协程-yield.html">
            
                
                    <a href="../day07/04.协程-yield.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        协程-yield
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="day07/05.协程-greenlet.html">
            
                
                    <a href="../day07/05.协程-greenlet.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        协程-greenlet
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="day07/06.协程-gevent.html">
            
                
                    <a href="../day07/06.协程-gevent.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        协程-gevent
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7" data-path="day07/07.进程、线程、协程对比.html">
            
                
                    <a href="../day07/07.进程、线程、协程对比.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.</b>
                        
                        进程、线程、协程区别
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.8" data-path="day07/08.案例-gevent多任务图片下载.html">
            
                
                    <a href="../day07/08.案例-gevent多任务图片下载.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.8.</b>
                        
                        案例-gevent多任务图片下载
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="day08/index.html">
            
                
                    <a href="../day08/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        正则表达式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="day08/01.正则表达式的介绍.html">
            
                
                    <a href="../day08/01.正则表达式的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        正则表达式的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="day08/02.re模块介绍.html">
            
                
                    <a href="../day08/02.re模块介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.2.</b>
                        
                        re模块介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="day08/03.匹配单个字符.html">
            
                
                    <a href="../day08/03.匹配单个字符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.3.</b>
                        
                        匹配单个字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.4" data-path="day08/04.匹配多个字符.html">
            
                
                    <a href="../day08/04.匹配多个字符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.4.</b>
                        
                        匹配多个字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.5" data-path="day08/05.匹配开头和结尾.html">
            
                
                    <a href="../day08/05.匹配开头和结尾.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.5.</b>
                        
                        匹配开头和结尾
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.6" data-path="day08/06.匹配分组.html">
            
                
                    <a href="../day08/06.匹配分组.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.6.</b>
                        
                        匹配分组
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.7" data-path="day08/07.re模块的高级用法.html">
            
                
                    <a href="../day08/07.re模块的高级用法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.7.</b>
                        
                        re模块的高级用法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.8" data-path="day08/08.贪婪和非贪婪.html">
            
                
                    <a href="../day08/08.贪婪和非贪婪.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.8.</b>
                        
                        贪婪和非贪婪
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.9" data-path="day08/09.r的作用.html">
            
                
                    <a href="../day08/09.r的作用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.9.</b>
                        
                        r的作用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="9" data-path="day09/index.html">
            
                
                    <a href="../day09/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        HTTP协议
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="day09/01.浏览器访问服务器的过程.html">
            
                
                    <a href="../day09/01.浏览器访问服务器的过程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        浏览器访问服务器的过程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="day09/02.http协议.html">
            
                
                    <a href="../day09/02.http协议.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.2.</b>
                        
                        HTTP协议介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.3" data-path="day09/03.谷歌浏览器开发者工具查看http协议的通信过程.html">
            
                
                    <a href="../day09/03.谷歌浏览器开发者工具查看http协议的通信过程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.3.</b>
                        
                        开发工具查看http协议通信过程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.4" data-path="day09/04.http请求报文.html">
            
                
                    <a href="../day09/04.http请求报文.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.4.</b>
                        
                        HTTP请求报文格式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.5" data-path="day09/05.获取请求报文原数据.html">
            
                
                    <a href="../day09/05.获取请求报文原数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.5.</b>
                        
                        获取请求报文原数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.6" data-path="day09/06.http响应报文.html">
            
                
                    <a href="../day09/06.http响应报文.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.6.</b>
                        
                        HTTP响应报文格式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.7" data-path="day09/07.tcp长连接和短连接.html">
            
                
                    <a href="../day09/07.tcp长连接和短连接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.7.</b>
                        
                        长连接和短连接
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.8" data-path="day09/08.案例-模拟浏览器的实现.html">
            
                
                    <a href="../day09/08.案例-模拟浏览器的实现.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.8.</b>
                        
                        案例-模拟浏览器的实现
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="10" data-path="day10/index.html">
            
                
                    <a href="../day10/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        Web静态服务器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="10.1" data-path="day10/01.返回固定数据.html">
            
                
                    <a href="../day10/01.返回固定数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.1.</b>
                        
                        返回固定数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.2" data-path="day10/02.返回固定页面数据.html">
            
                
                    <a href="../day10/02.返回固定页面数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.2.</b>
                        
                        返回固定页面数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.3" data-path="day10/03.返回指定页面数据.html">
            
                
                    <a href="../day10/03.返回指定页面数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.3.</b>
                        
                        返回指定页面数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.4" data-path="day10/04.返回404页面数据.html">
            
                
                    <a href="../day10/04.返回404页面数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.4.</b>
                        
                        返回404页面数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.5" data-path="day10/05.多任务web服务器.html">
            
                
                    <a href="../day10/05.多任务web服务器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.5.</b>
                        
                        多任务web服务器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.6" data-path="day10/06.web服务器面向对象开发.html">
            
                
                    <a href="../day10/06.web服务器面向对象开发.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.6.</b>
                        
                        web服务器面向对象开发
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.7" data-path="day10/07.给web服务器添加命令行参数.html">
            
                
                    <a href="../day10/07.给web服务器添加命令行参数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.7.</b>
                        
                        给web服务器添加命令行参数
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本書使用 GitBook 釋出
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >python高级</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x4E92;&#x65A5;&#x9501;">&#x4E92;&#x65A5;&#x9501;</h1>
<h2 id="&#x76EE;&#x6807;">&#x76EE;&#x6807;</h2>
<ul>
<li>&#x77E5;&#x9053;&#x4E92;&#x65A5;&#x9501;&#x7684;&#x4F5C;&#x7528;</li>
</ul>
<h3 id="1&#x4E92;&#x65A5;&#x9501;&#x7684;&#x6982;&#x5FF5;">1.&#x4E92;&#x65A5;&#x9501;&#x7684;&#x6982;&#x5FF5;</h3>
<blockquote>
<p>&#x4E92;&#x65A5;&#x9501;: &#x5BF9;&#x5171;&#x4EAB;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x9501;&#x5B9A;&#xFF0C;&#x4FDD;&#x8BC1;&#x540C;&#x4E00;&#x65F6;&#x523B;&#x53EA;&#x80FD;&#x6709;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x53BB;&#x64CD;&#x4F5C;&#x3002;</p>
</blockquote>
<p>&#x6CE8;&#x610F;:</p>
<ul>
<li>&#x62A2;&#x5230;&#x9501;&#x7684;&#x7EBF;&#x7A0B;&#x5148;&#x6267;&#x884C;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x9501;&#x7684;&#x7EBF;&#x7A0B;&#x9700;&#x8981;&#x7B49;&#x5F85;&#xFF0C;&#x7B49;&#x9501;&#x7528;&#x5B8C;&#x540E;&#x9700;&#x8981;&#x91CA;&#x653E;&#xFF0C;&#x7136;&#x540E;&#x5176;&#x5B83;&#x7B49;&#x5F85;&#x7684;&#x7EBF;&#x7A0B;&#x518D;&#x53BB;&#x62A2;&#x8FD9;&#x4E2A;&#x9501;&#xFF0C;&#x90A3;&#x4E2A;&#x7EBF;&#x7A0B;&#x62A2;&#x5230;&#x90A3;&#x4E2A;&#x7EBF;&#x7A0B;&#x518D;&#x6267;&#x884C;&#x3002;</li>
<li>&#x5177;&#x4F53;&#x90A3;&#x4E2A;&#x7EBF;&#x7A0B;&#x62A2;&#x5230;&#x8FD9;&#x4E2A;&#x9501;&#x6211;&#x4EEC;&#x51B3;&#x5B9A;&#x4E0D;&#x4E86;&#xFF0C;&#x662F;&#x7531;cpu&#x8C03;&#x5EA6;&#x51B3;&#x5B9A;&#x7684;&#x3002;</li>
</ul>
<p>&#x4E3A;&#x4E86;&#x66F4;&#x597D;&#x7684;&#x7406;&#x89E3;&#x4E92;&#x65A5;&#x9501;&#xFF0C;&#x8BF7;&#x770B;&#x4E0B;&#x9762;&#x7684;&#x56FE;:</p>
<p><img src="imgs/&#x94F6;&#x884C;&#x6392;&#x961F;.png" alt="&#x94F6;&#x884C;&#x6392;&#x961F;"></p>
<p>&#x7EBF;&#x7A0B;&#x540C;&#x6B65;&#x80FD;&#x591F;&#x4FDD;&#x8BC1;&#x591A;&#x4E2A;&#x7EBF;&#x7A0B;&#x5B89;&#x5168;&#x8BBF;&#x95EE;&#x7ADE;&#x4E89;&#x8D44;&#x6E90;&#xFF0C;&#x6700;&#x7B80;&#x5355;&#x7684;&#x540C;&#x6B65;&#x673A;&#x5236;&#x662F;&#x5F15;&#x5165;&#x4E92;&#x65A5;&#x9501;&#x3002;</p>
<p>&#x4E92;&#x65A5;&#x9501;&#x4E3A;&#x8D44;&#x6E90;&#x5F15;&#x5165;&#x4E00;&#x4E2A;&#x72B6;&#x6001;&#xFF1A;&#x9501;&#x5B9A;/&#x975E;&#x9501;&#x5B9A;</p>
<p>&#x67D0;&#x4E2A;&#x7EBF;&#x7A0B;&#x8981;&#x66F4;&#x6539;&#x5171;&#x4EAB;&#x6570;&#x636E;&#x65F6;&#xFF0C;&#x5148;&#x5C06;&#x5176;&#x9501;&#x5B9A;&#xFF0C;&#x6B64;&#x65F6;&#x8D44;&#x6E90;&#x7684;&#x72B6;&#x6001;&#x4E3A;&#x201C;&#x9501;&#x5B9A;&#x201D;&#xFF0C;&#x5176;&#x4ED6;&#x7EBF;&#x7A0B;&#x4E0D;&#x80FD;&#x66F4;&#x6539;&#xFF1B;&#x76F4;&#x5230;&#x8BE5;&#x7EBF;&#x7A0B;&#x91CA;&#x653E;&#x8D44;&#x6E90;&#xFF0C;&#x5C06;&#x8D44;&#x6E90;&#x7684;&#x72B6;&#x6001;&#x53D8;&#x6210;&#x201C;&#x975E;&#x9501;&#x5B9A;&#x201D;&#xFF0C;&#x5176;&#x4ED6;&#x7684;&#x7EBF;&#x7A0B;&#x624D;&#x80FD;&#x518D;&#x6B21;&#x9501;&#x5B9A;&#x8BE5;&#x8D44;&#x6E90;&#x3002;&#x4E92;&#x65A5;&#x9501;&#x4FDD;&#x8BC1;&#x4E86;&#x6BCF;&#x6B21;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x8FDB;&#x884C;&#x5199;&#x5165;&#x64CD;&#x4F5C;&#xFF0C;&#x4ECE;&#x800C;&#x4FDD;&#x8BC1;&#x4E86;&#x591A;&#x7EBF;&#x7A0B;&#x60C5;&#x51B5;&#x4E0B;&#x6570;&#x636E;&#x7684;&#x6B63;&#x786E;&#x6027;&#x3002;</p>
<p>threading&#x6A21;&#x5757;&#x4E2D;&#x5B9A;&#x4E49;&#x4E86;Lock&#x53D8;&#x91CF;&#xFF0C;&#x8FD9;&#x4E2A;&#x53D8;&#x91CF;&#x672C;&#x8D28;&#x4E0A;&#x662F;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF0C;&#x53EF;&#x4EE5;&#x65B9;&#x4FBF;&#x7684;&#x5904;&#x7406;&#x9501;&#x5B9A;&#xFF1A;</p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x521B;&#x5EFA;&#x9501;</span>
mutex = threading.Lock()

<span class="hljs-comment"># &#x9501;&#x5B9A;</span>
mutex.acquire()

<span class="hljs-comment"># &#x91CA;&#x653E;</span>
mutex.release()
</code></pre>
<h4 id="&#x6CE8;&#x610F;&#xFF1A;">&#x6CE8;&#x610F;&#xFF1A;</h4>
<ul>
<li>&#x5982;&#x679C;&#x8FD9;&#x4E2A;&#x9501;&#x4E4B;&#x524D;&#x662F;&#x6CA1;&#x6709;&#x4E0A;&#x9501;&#x7684;&#xFF0C;&#x90A3;&#x4E48;acquire&#x4E0D;&#x4F1A;&#x5835;&#x585E;</li>
<li>&#x5982;&#x679C;&#x5728;&#x8C03;&#x7528;acquire&#x5BF9;&#x8FD9;&#x4E2A;&#x9501;&#x4E0A;&#x9501;&#x4E4B;&#x524D; &#x5B83;&#x5DF2;&#x7ECF;&#x88AB; &#x5176;&#x4ED6;&#x7EBF;&#x7A0B;&#x4E0A;&#x4E86;&#x9501;&#xFF0C;&#x90A3;&#x4E48;&#x6B64;&#x65F6;acquire&#x4F1A;&#x5835;&#x585E;&#xFF0C;&#x76F4;&#x5230;&#x8FD9;&#x4E2A;&#x9501;&#x88AB;&#x89E3;&#x9501;&#x4E3A;&#x6B62;</li>
</ul>
<h3 id="2&#x4F7F;&#x7528;&#x4E92;&#x65A5;&#x9501;&#x5B8C;&#x6210;2&#x4E2A;&#x7EBF;&#x7A0B;&#x5BF9;&#x540C;&#x4E00;&#x4E2A;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x5404;&#x52A0;100&#x4E07;&#x6B21;&#x7684;&#x64CD;&#x4F5C;">2.&#x4F7F;&#x7528;&#x4E92;&#x65A5;&#x9501;&#x5B8C;&#x6210;2&#x4E2A;&#x7EBF;&#x7A0B;&#x5BF9;&#x540C;&#x4E00;&#x4E2A;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x5404;&#x52A0;100&#x4E07;&#x6B21;&#x7684;&#x64CD;&#x4F5C;</h3>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> threading


<span class="hljs-comment"># &#x5B9A;&#x4E49;&#x5168;&#x5C40;&#x53D8;&#x91CF;</span>
g_num = <span class="hljs-number">0</span>

<span class="hljs-comment"># &#x521B;&#x5EFA;&#x5168;&#x5C40;&#x4E92;&#x65A5;&#x9501;</span>
lock = threading.Lock()


<span class="hljs-comment"># &#x5FAA;&#x73AF;&#x4E00;&#x6B21;&#x7ED9;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x52A0;1</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">sum_num1</span><span class="hljs-params">()</span>:</span>
    <span class="hljs-comment"># &#x4E0A;&#x9501;</span>
    lock.acquire()
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(<span class="hljs-number">1000000</span>):
        <span class="hljs-keyword">global</span> g_num
        g_num += <span class="hljs-number">1</span>

    print(<span class="hljs-string">&quot;sum1:&quot;</span>, g_num)
    <span class="hljs-comment"># &#x91CA;&#x653E;&#x9501;</span>
    lock.release()


<span class="hljs-comment"># &#x5FAA;&#x73AF;&#x4E00;&#x6B21;&#x7ED9;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x52A0;1</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">sum_num2</span><span class="hljs-params">()</span>:</span>
    <span class="hljs-comment"># &#x4E0A;&#x9501;</span>
    lock.acquire()
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(<span class="hljs-number">1000000</span>):
        <span class="hljs-keyword">global</span> g_num
        g_num += <span class="hljs-number">1</span>
    print(<span class="hljs-string">&quot;sum2:&quot;</span>, g_num)
    <span class="hljs-comment"># &#x91CA;&#x653E;&#x9501;</span>
    lock.release()


<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">&apos;__main__&apos;</span>:
    <span class="hljs-comment"># &#x521B;&#x5EFA;&#x4E24;&#x4E2A;&#x7EBF;&#x7A0B;</span>
    first_thread = threading.Thread(target=sum_num1)
    second_thread = threading.Thread(target=sum_num2)
    <span class="hljs-comment"># &#x542F;&#x52A8;&#x7EBF;&#x7A0B;</span>
    first_thread.start()
    second_thread.start()

    <span class="hljs-comment"># &#x63D0;&#x793A;&#xFF1A;&#x52A0;&#x4E0A;&#x4E92;&#x65A5;&#x9501;&#xFF0C;&#x90A3;&#x4E2A;&#x7EBF;&#x7A0B;&#x62A2;&#x5230;&#x8FD9;&#x4E2A;&#x9501;&#x6211;&#x4EEC;&#x51B3;&#x5B9A;&#x4E0D;&#x4E86;&#xFF0C;&#x90A3;&#x7EBF;&#x7A0B;&#x62A2;&#x5230;&#x9501;&#x90A3;&#x4E2A;&#x7EBF;&#x7A0B;&#x5148;&#x6267;&#x884C;&#xFF0C;&#x6CA1;&#x6709;&#x62A2;&#x5230;&#x7684;&#x7EBF;&#x7A0B;&#x9700;&#x8981;&#x7B49;&#x5F85;</span>
    <span class="hljs-comment"># &#x52A0;&#x4E0A;&#x4E92;&#x65A5;&#x9501;&#x591A;&#x4EFB;&#x52A1;&#x77AC;&#x95F4;&#x53D8;&#x6210;&#x5355;&#x4EFB;&#x52A1;&#xFF0C;&#x6027;&#x80FD;&#x4F1A;&#x4E0B;&#x964D;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#x540C;&#x4E00;&#x65F6;&#x523B;&#x53EA;&#x80FD;&#x6709;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x53BB;&#x6267;&#x884C;</span>
</code></pre>
<p>&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#xFF1A;</p>
<pre><code class="lang-python">sum1: <span class="hljs-number">1000000</span>
sum2: <span class="hljs-number">2000000</span>
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x6700;&#x540E;&#x7684;&#x7ED3;&#x679C;&#xFF0C;&#x52A0;&#x5165;&#x4E92;&#x65A5;&#x9501;&#x540E;&#xFF0C;&#x5176;&#x7ED3;&#x679C;&#x4E0E;&#x9884;&#x671F;&#x4E00;&#x6837;&#x3002;</p>
<h3 id="4-&#x4F7F;&#x7528;&#x4E92;&#x65A5;&#x9501;&#x7684;&#x76EE;&#x7684;">4. &#x4F7F;&#x7528;&#x4E92;&#x65A5;&#x9501;&#x7684;&#x76EE;&#x7684;</h3>
<p>&#x80FD;&#x591F;&#x4FDD;&#x8BC1;&#x591A;&#x4E2A;&#x7EBF;&#x7A0B;&#x8BBF;&#x95EE;&#x5171;&#x4EAB;&#x6570;&#x636E;&#x4E0D;&#x4F1A;&#x51FA;&#x73B0;&#x8D44;&#x6E90;&#x7ADE;&#x4E89;&#x53CA;&#x6570;&#x636E;&#x9519;&#x8BEF;</p>
<h3 id="5-&#x4E0A;&#x9501;&#x3001;&#x89E3;&#x9501;&#x8FC7;&#x7A0B;">5. &#x4E0A;&#x9501;&#x3001;&#x89E3;&#x9501;&#x8FC7;&#x7A0B;</h3>
<p>&#x5F53;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x8C03;&#x7528;&#x9501;&#x7684;acquire()&#x65B9;&#x6CD5;&#x83B7;&#x5F97;&#x9501;&#x65F6;&#xFF0C;&#x9501;&#x5C31;&#x8FDB;&#x5165;&#x201C;locked&#x201D;&#x72B6;&#x6001;&#x3002;</p>
<p>&#x6BCF;&#x6B21;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x9501;&#x3002;&#x5982;&#x679C;&#x6B64;&#x65F6;&#x53E6;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x8BD5;&#x56FE;&#x83B7;&#x5F97;&#x8FD9;&#x4E2A;&#x9501;&#xFF0C;&#x8BE5;&#x7EBF;&#x7A0B;&#x5C31;&#x4F1A;&#x53D8;&#x4E3A;&#x201C;blocked&#x201D;&#x72B6;&#x6001;&#xFF0C;&#x79F0;&#x4E3A;&#x201C;&#x963B;&#x585E;&#x201D;&#xFF0C;&#x76F4;&#x5230;&#x62E5;&#x6709;&#x9501;&#x7684;&#x7EBF;&#x7A0B;&#x8C03;&#x7528;&#x9501;&#x7684;release()&#x65B9;&#x6CD5;&#x91CA;&#x653E;&#x9501;&#x4E4B;&#x540E;&#xFF0C;&#x9501;&#x8FDB;&#x5165;&#x201C;unlocked&#x201D;&#x72B6;&#x6001;&#x3002;</p>
<p>&#x7EBF;&#x7A0B;&#x8C03;&#x5EA6;&#x7A0B;&#x5E8F;&#x4ECE;&#x5904;&#x4E8E;&#x540C;&#x6B65;&#x963B;&#x585E;&#x72B6;&#x6001;&#x7684;&#x7EBF;&#x7A0B;&#x4E2D;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x6765;&#x83B7;&#x5F97;&#x9501;&#xFF0C;&#x5E76;&#x4F7F;&#x5F97;&#x8BE5;&#x7EBF;&#x7A0B;&#x8FDB;&#x5165;&#x8FD0;&#x884C;&#xFF08;running&#xFF09;&#x72B6;&#x6001;&#x3002;</p>
<h3 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h3>
<p>&#x9501;&#x7684;&#x597D;&#x5904;&#xFF1A;</p>
<ul>
<li>&#x786E;&#x4FDD;&#x4E86;&#x67D0;&#x6BB5;&#x5173;&#x952E;&#x4EE3;&#x7801;&#x53EA;&#x80FD;&#x7531;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x4ECE;&#x5934;&#x5230;&#x5C3E;&#x5B8C;&#x6574;&#x5730;&#x6267;&#x884C;</li>
</ul>
<p>&#x9501;&#x7684;&#x574F;&#x5904;&#xFF1A;</p>
<ul>
<li>&#x591A;&#x7EBF;&#x7A0B;&#x6267;&#x884C;&#x53D8;&#x6210;&#x4E86;&#x5305;&#x542B;&#x9501;&#x7684;&#x67D0;&#x6BB5;&#x4EE3;&#x7801;&#x5B9E;&#x9645;&#x4E0A;&#x53EA;&#x80FD;&#x4EE5;&#x5355;&#x7EBF;&#x7A0B;&#x6A21;&#x5F0F;&#x6267;&#x884C;&#xFF0C;&#x6548;&#x7387;&#x5C31;&#x5927;&#x5927;&#x5730;&#x4E0B;&#x964D;&#x4E86;</li>
<li>&#x9501;&#x4F7F;&#x7528;&#x4E0D;&#x597D;&#x5C31;&#x5BB9;&#x6613;&#x51FA;&#x73B0;&#x6B7B;&#x9501;&#x60C5;&#x51B5;</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../day05/06.多线程-共享全局变量问题.html" class="navigation navigation-prev " aria-label="Previous page: 多线程-共享全局变量问题"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../day05/08.死锁.html" class="navigation navigation-next " aria-label="Next page: 死锁"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"toggle-chapters":{},"splitter":{},"emphasize":{},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book python高级 -->
</html>
